#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLineEdit>
#include <QGridLayout>
#include<QPushButton>
#include<QMessageBox>
#include <QFileDialog>
#include <QCloseEvent>
#include <QString>
#include <QTextStream>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    bool LoadFile(const QString &filename);

private slots:
    void on_actionOpen_O_triggered();

    void on_actionSave_S_triggered();

    void on_actionSave_as_A_triggered();

    void on_actionNews_N_triggered();

    void on_actionClose_C_triggered();

    void on_actionback_triggered();

    void on_actioncopy_c_triggered();

    void on_actionPaste_V_triggered();
protected:
    void  closeEvent(QCloseEvent *event);
private:
    Ui::MainWindow *ui;
    void NewFiles();
    bool Save();
    bool SaveAs();
    bool isSave();
    bool isUntitle;
    QString curfile;
    bool SaveFile(const QString &filename);
};

#endif // MAINWINDOW_H
